<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org"><!-- 引入命名空间 -->
<head>
    <title>山朴奈竞赛</title>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}"></link>
    <link rel="stylesheet" th:href="@{/css/common.css}">
	<link rel="stylesheet" th:href="@{/css/picture.css}">

	
</head>

<body>
    <div class="nav">
        <h5>山朴奈</h5>
        <div class="spacer"></div>
		<a th:href="@{/}">首页</a>
		<a th:href="@{/user/oneself}">修改信息</a>
		<a th:href="@{/contest/view}">竞赛项目列表</a>
		<a th:href="@{/team/list}">竞赛队伍列表</a>
		<a th:href="@{/picture/list}">上传获奖证书</a>
		<a th:unless="${user!= null}" th:href="@{/application/listStudent}">我的竞赛</a>
		<a th:href="@{/login}">登录管理</a>

    </div>
    <!-- 添加搜索框 -->
    <div class="container mt-3">
        <form class="d - flex" role="search">
            <input class="form - control me - 2" type="search" placeholder="搜索" aria - label="Search">
            <button class="btn btn - secondary" type="submit">搜索</button>
        </form>
    </div>

    <div class="container mt-3">
        <h2>证书列表</h2>
        <table class="table table-bordered table - hover">
            <thead class="thead - dark">
            <tr>
                <th>ID</th>
                <th>证书名称</th>
                <th>发布日期</th>
                <th>证书</th>
                <th>审核</th>
            </tr>
            </thead>
            <tbody>
            <!-- 使用Thymeleaf遍历文章列表 -->
            <tr th:each="picture : ${pictureList}">
                <td th:text="${picture.id}">1</td>
                <td th:text="${picture.filename}">图片名称</td>
                <td th:text="${#dates.format(picture.createTime, 'yyyy - MM - dd HH:mm:ss')}">发布日期</td>
                <td><img th:src="@{${picture.url}}" alt="私人图片" style="width: 100px; height: 100;"></td>
                <td>
						<div  th:if="${picture.statu==0}">
						    <span class=status-pending>在审核中</span><br>
							<a class=confirm-pass th:unless="${session.user.id!=5}" th:href="@{/picture/update(Id= ${picture.id})}" role="button" onclick="return confirm('确定通过吗？')">确认通过</a>

						</div>
						<div class=status-passed th:if="${picture.statu==1}">
						    <span>审核通过</span>
						</div>
					
                    <a class="cancel-btn" th:href="@{/picture/delete(id = ${picture.id})}" role="button" onclick="return confirm('确定要删除吗？')">取消</a>
					
                </td>
            </tr>
            </tbody>
        </table>
    </div>
	<form method="POST" action="/picture/upload" enctype="multipart/form-data">
	    <div class="mb-3">
	        <input type="file" name="file" class="form - control" />
	    </div>
	    <button type="submit" class="btn btn - success">上传</button>
	</form>
    <!-- 引入Bootstrap JS -->
    <script src="https://cdn.bootcdn.net/ajax/libs/twitter - bootstrap/5.3.2/js/bootstrap.bundle.min.js"></script>
</body>
</html>